package com.anda.jsu.yangsp.core.view.util;

import java.util.ArrayList;
import java.util.List;

/**
 * 分页
 * 
 * @author xiaolu
 * @since 2012-12-06
 * 
 * @param <T>
 */
public class PageModel<T> {

	private List<T> pageData = new ArrayList<T>();// 结果集
	private boolean isPage = true;
	private int pageSize = 20;// 每页显示条数
	private int currentPage = 1;// 当前页
	private Long totalCount;// 总页数
	private Long totalPage;// 总页数

	public List<T> getPageData() {
		return pageData;
	}

	public void setPageData(List<T> pageData) {
		this.pageData = pageData;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public Long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Long totalCount) {
		Long mod = totalCount/pageSize;
		mod = mod==0?mod:(mod + 1);
		this.totalCount = mod;
	}

	public void setPage(boolean isPage) {
		this.isPage = isPage;
	}

	public boolean isPage() {
		return isPage;
	}

	public void setTotalPage(Long totalPage) {
		this.totalPage = totalPage;
	}

	public Long getTotalPage() {
		return totalPage;
	}

}
